﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace StoreHouseA
{
    using StoreHouseDataSetTableAdapters;

    public partial class Form5 : Form
    {
        public Form5()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            insert_codec();
            this.Close();
        }

        private void insert_codec()
        {
            string in_customer = comboBox1.Text;
            string in_new = comboBox4.Text;
            string in_old = comboBox2.Text;
            string in_level = comboBox3.Text;
            string in_location = textBox1.Text;
            decimal in_weight = numericUpDown1.Value;
            string in_memo = textBox10.Text;
            DateTime in_date = dateTimePicker1.Value.Date;

            string in_oman = Program.oman;
            DateTime in_otime = DateTime.Now;

            tb_inoutTableAdapter a = new tb_inoutTableAdapter();
            a.Insert(in_old, in_level, in_customer, in_location, 0, in_weight,
                in_date, "", "", "", in_new, "", in_memo, in_oman, in_otime);
            QueriesTableAdapter q = new QueriesTableAdapter();
            q.submit_deal(in_old, in_customer, in_date);
            a.Insert(in_new, in_level, in_customer, in_location, in_weight, 0, in_date,
                "", "", "", in_old, "", in_memo, in_oman, in_otime);
        }

        private void button1_Click(object sender, EventArgs e)
        {
        }

        private void textBox2_Click(object sender, EventArgs e)
        {
        }

        private void textBox3_Click(object sender, EventArgs e)
        {

        }

        private void textBox4_Click(object sender, EventArgs e)
        {
        }
    }
}
